/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.manager.deleteairport;

import assignment_cp3120.DAO.Factory.DAOFactory;
import assignment_cp3120.dataObjects.DepartureLocation;
import java.util.Vector;

/**
 *
 * @author Administrator
 */
public class DeleteAirportModel {
    private Vector<DepartureLocation> airports;

    public DeleteAirportModel() {
        loadAirports();
    }
    public void loadAirports() {
        airports = DAOFactory.getDAOFactory().getDepartureLocationDAO().getDepLocations();
    }

    public Vector<DepartureLocation> getAirports() {
        return airports;
    }

    public void setAirports(Vector<DepartureLocation> airports) {
        this.airports = airports;
    }
    public void deleteAirportByID(String id) {
        DAOFactory.getDAOFactory().getDepartureLocationDAO().deleteAirport(id);
        DAOFactory.getDAOFactory().getDestinationDAO().deleteDestination(id);
        loadAirports();
    }
}
